Creative Data Visualization: Electrophysiology Data

require(tidyverse)
require(knitr)
require(dplyr)
require(ggplot2)
require(gganimate)
# from github devtools::install_github('marcusvolz/mathart') require(mathart)
# devtools::install_github('cutterkom/generativeart') require(generativeart)
require(aRtsy)

Background on data

GSSG Oxidation of the Positive Charged Residues

1.
2.
3.
4.

load GSSG data

f1 <- "https://raw.githubusercontent.com/slcornett/creative-data-visualization/main/data/2018-04-05_GSSG_Oxidation.csv"
gssg <- read_csv(f1, col_names = TRUE)
## Rows: 321761 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (2): time_s, GSSG_Current_µA
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
gssg <- gssg %>%
    filter(time_s >= 1000, time_s <= 2000)  # make it slightly less giant

Trace Plots

# statics plot
gssg_p1 <- ggplot(data = gssg, aes(x = time_s, y = GSSG_Current_µA, color = GSSG_Current_µA)) + scale_color_continuous(type = "viridis") +
    geom_jitter() + theme_classic() + labs(title = "GSSG and Glycine", x = "time (s)", y = "Current (µA)")
gssg_p1

# animated! like a heart beat
gssg_a1 <- ggplot(data = gssg, aes(x = time_s, y = GSSG_Current_µA, color = GSSG_Current_µA)) + scale_color_continuous(type = "viridis") +
    geom_jitter() + theme_classic() + labs(title = "GSSG and Glycine: {frame_time}", x = "time (s)",
    y = "Current (µA)") + transition_time(time = gssg$time_s) + shadow_wake(wake_length = 0.2, alpha = FALSE) +
    ease_aes("linear")
gssg_a1

# with a trace
gssg_a2 <- ggplot(data = gssg, aes(x = time_s, y = GSSG_Current_µA, color = GSSG_Current_µA)) + scale_color_continuous(type = "viridis") +
    geom_jitter() + theme_classic() + labs(title = "GSSG and Glycine: {frame_time}", x = "time (s)",
    y = "Current (µA)") + transition_time(time = gssg$time_s) + shadow_wake(wake_length = 0.1, alpha = FALSE) +
    shadow_mark(alpha = 0.3, size = 1) + ease_aes("linear")
gssg_a2